import {DomEditor, IDomEditor} from "@wangeditor/editor";

export function Intention<T extends IDomEditor>(editor: T) {
    const { insertBreak } = editor
    const newEditor = editor
    setTimeout(() => {
        // beforeInput 事件不能识别 ctrl+enter ，所以自己绑定 DOM 事件
        const { $textArea } = DomEditor.getTextarea(newEditor)
        if ($textArea == null) return
        $textArea.on('keydown', e => {
            const event = e as KeyboardEvent
            const isAlt = event.altKey || event.metaKey
            if (event.key === 'Enter' && isAlt) {
                // alt+enter 触发编辑意图 判断是否打开提示

            }
        })
    })
    return newEditor
}

function Hint<T extends IDomEditor>(editor: T) {

}

